<?php

class Menu_model extends Model{

	var $table_name = 'menu';
	
	function Menu_model()
	{
		parent::Model();
	}
	
	function get_row($field,$where_field,$where_value)
	{
		$this->db->select($field);	
		$this->db->where($where_field,$where_value);
		$this->db->where('status','A');
		$query = $this->db->get($this->table_name,1);	
		return $query;
	}	
	
	function get_rows($field,$where_field,$where_value)
	{
		$this->db->select($field);	
		$this->db->where($where_field,$where_value);
		$this->db->where('status','A');
		$query = $this->db->get($this->table_name);	
		return $query;
	}
	
	function get_menus($parent_id)
	{
		$this->db->select('id,status,title,link,slug');	
		$this->db->where('parent_id',$parent_id);
		$this->db->where('status','A');
		$this->db->orderby('sort','ASC');
		$query = $this->db->get($this->table_name);	
		return $query;
	}	
	
}

/* End of file menu_model.php */
?>